class Sequel::Graph
end

graph = Sequel::Graph.new(:nodes) do
  one_to_many :attributes, :table => :attributes, :key => :id, :remote_key => :node_id
  many_to_one :parent, :table => :nodes, :key => :parent_id, :remote_key => :id
end

nodes = graph.load
...
graph.save(nodes)

graph.delete

graph.save!(nodes) # deletes and then saves

